<h1>上传作品</h1>

<% form_for(@work, :html => {:multipart => true}) do |f| %>
	<%= f.error_messages :header_message => nil, :message => nil%>
    <%= simple_text_field_for f, :title, { :text=>"标题" }%>
	<div class="required">
		<div class="form_text">
			<label for="work[retype]" class="label">选择分类</label>
			<span class="required_mark">*</span>
		</div>
		<%= f.select(:retype_id, Retype.find(:all).collect {|t| [ t.name, t.id ] })%>
	</div>
    <%= simple_text_area_for f, :content, { :text=>"描述", :cols =>30, :rows => 5 } %>
	<% f.fields_for :pictures,Picture.new do |p| %>
   		<%= render :partial => 'picture', :locals=>{:f=>p}%>
    <% end %>
  	<%= add_picture(f) %>
    <%= f.submit '创建' %>
<% end %>

<%= link_to '返回', works_path %>